home *** CD-ROM | disk | FTP | other *** search
-
- // JavaScript property window sample. Connects to geometric layer using model-view
- // concept and reports all events to the user through a read only text field.
- // Copyrights 2002, Realsoft Graphics Oy
-
- // --- include java script classes ---
-
- include("oops/r3button.js");
- include("oops/r3window.js");
- include("oops/r3packer.js");
- include("oops/r3text.js");
-
-
- // create a window
-
- view = new r3Window(R3WGA_Parent, _r3gui,
- R3WGA_Left, 200,
- R3WGA_Top, 100,
- R3WA_Title, "My Property Window",
- R3WA_ReportCloseWindow, TRUE,
- R3WA_ReportNewSize, TRUE);
-
- // create a text field for the window
-
- info = new r3Text(R3WGA_Parent, view,
- R3GA_Text, "Event",
- R3GTA_Border, TRUE);
-
-
- // use packer to manage the text field
- packer = new r3Packer(R3PA_Orientation, R3PAOF_VERTICAL);
- packer.ADD(R3PAPF_FILLX, R3PAAF_ALIGN, info);
- view.SetGmanager(packer);
-
-
- // define update method for the model-view
-
- function myUPDATE(value, modelID, eventID)
- {
- info.SetText("Event: " + eventID);
- }
-
- view.UPDATE = myUPDATE;
-
-
- // connect the window to geom. layer
-
- model = GetJS("CurrentProject.Geometrics");
- model.ADDDEPENDENT(0, 0, view);
-
- // update the layout and realize the window
- view.FIT(R3WFP_BESTFIT);
- view.REALIZE();
-